/**
 *	\file AKInteractiveDrawing.h
 *  
 *  \section desc_sec Description
 *  Definition of AKInteractiveDrawing protocol
 *  
 *  \if copyright
 *  	Copyright 2008 Ben Chen. All rights reserved.
 *  \endif
 *  
 *  \section hist_sec Change History:
 *  	-	2/3/08		BC		Created this file
 *  
 *  <hr>
 *  \addtogroup AnimalKingdom
 *  @{
 */

/**
 *	This protocol defines the how AKHumanPlayer interacts with the drawing system.
 */
@protocol AKInteractiveDrawing


@property (readonly, retain) AKView* drawingView;

/**
 *	Return the index of the cell where the \p position is enclosed.
 *	\return NSNotFound if no cell is enclosing the \p position.
 */
- (AKCellIndex)cellIndexForPoint:(CGPoint)position;

// Thie flowing methods are needed only when pieces can be moved around.
@optional

/**
 *	Activate a piece.
 *	This method is normally called when the user place the cursor above a moveable piece. If there is 
 *	another piece that had been activated prior to \p piece, and is different from \p piece it will be
 *	deactivated first, regardless of if the \p piece can be activated.
 */
- (void)activatePiece:(AKPiece)piece;

/**
 *	Deactivate the piece (if any) that had been activated.
 */
- (void)deactivatePiece;

/**
 *	Notify the drawing system that a specified piece is about to be dragged.
 */
- (void)aboutToDragPiece:(AKPiece)piece atPoint:(CGPoint)aPoint;

/**
 *	Notify the drawing system the new position of the piece being dragged.
 *	This method does nothing if \p aboutToDragPiece: was not called or it failed.
 */
- (void)dragPieceAt:(CGPoint)point;

/**
 *	Notify the drawing system the dragging is finished.
 *	This method does nothing if \p aboutToDragPiece: was not called or it fails.
 */
- (void)stopDraggingShouldComeBack:(BOOL)flag;

@end

/** @} */
